﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.Data
{
	public sealed class CancellationToken : ICancellationToken
	{
		public CancellationToken()
		{
			UniqueIdentifier = Guid.NewGuid().ToString();
		}

		public string UniqueIdentifier { get; private set; }

		public void Cancel()
		{
			if (Cancelled != null)
			{
				Cancelled(this, EventArgs.Empty);
			}
		}

		public event EventHandler<object> Cancelled;
	}
}
